package cn.wink.springcloud.config;

import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

/**
 * 配置类等效于applicationcontext.xml
 * @author xw
 * @date 2020-05-03 14:22
 */
@Configuration
public class ApplicationContextConfig {

    /**
     * @Bean 等效 <bean id=“” >xxx</bean>
     *
     * @return org.springframework.web.client.RestTemplate
     * @author xw
     * @date 2020/5/3 14:23
     */
    @Bean
    @LoadBalanced
    public RestTemplate getRestTemplate(){
        return new RestTemplate();
    }
}
